import React, { PureComponent } from 'react'
import { withRouter } from 'react-router-dom'
class ListItem extends PureComponent {
  goDes=(item)=>{
    this.props.history.push(`/moviedes/${item.id}/${item.nm}`)
    this.props.recordDes(item)
  }
  render() {
    let { list } = this.props
    return (
      <ul>
        {
          list.map(item => {
            return (
              <li key={item.id} onClick={()=>this.goDes(item)}>
                <div>
                  <img src={item.img} alt="" />
                </div>
                <div className="xiXi">
                  <h4>
                    {item.nm}
                  </h4>
                  <p>
                    观众评 <span className="fen">{item.sc}</span>
                  </p>
                  <p className="zuYan">主演: {item.star}</p>
                  <p>{item.showInfo}</p>
                </div>
                <div className="goPiao">
                  <button className="goPiao_btn">购票</button>
                </div>
              </li>
            )
          })
        }
      </ul>
    )
  }
}
export default withRouter(ListItem)